3.153 \(\int \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx\)

Optimal. Leaf size=84 \[ -\frac {\left (a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {2 a b \sin (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d} \]

[Out]

-2*a*b*csc(d*x+c)/d-1/2*a^2*csc(d*x+c)^2/d-(a^2-b^2)*ln(sin(d*x+c))/d-2*a*b*sin(d*x+c)/d-1/2*b^2*sin(d*x+c)^2/
d

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2721, 894} \[ -\frac {\left (a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {2 a b \sin (c+d x)}{d}-\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^3*(a + b*Sin[c + d*x])^2,x]

[Out]

(-2*a*b*Csc[c + d*x])/d - (a^2*Csc[c + d*x]^2)/(2*d) - ((a^2 - b^2)*Log[Sin[c + d*x]])/d - (2*a*b*Sin[c + d*x]
)/d - (b^2*Sin[c + d*x]^2)/(2*d)

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2721

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )}{x^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\operatorname {Subst}\left (\int \left (-2 a+\frac {a^2 b^2}{x^3}+\frac {2 a b^2}{x^2}+\frac {-a^2+b^2}{x}-x\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {2 a b \csc (c+d x)}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {\left (a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {2 a b \sin (c+d x)}{d}-\frac {b^2 \sin ^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.26, size = 70, normalized size = 0.83 \[ -\frac {2 \left (a^2-b^2\right ) \log (\sin (c+d x))+a^2 \csc ^2(c+d x)+4 a b \sin (c+d x)+4 a b \csc (c+d x)+b^2 \sin ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^3*(a + b*Sin[c + d*x])^2,x]

[Out]

-1/2*(4*a*b*Csc[c + d*x] + a^2*Csc[c + d*x]^2 + 2*(a^2 - b^2)*Log[Sin[c + d*x]] + 4*a*b*Sin[c + d*x] + b^2*Sin
[c + d*x]^2)/d

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 115, normalized size = 1.37 \[ \frac {2 \, b^{2} \cos \left (d x + c\right )^{4} - 3 \, b^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + b^{2} - 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} + b^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) - 8 \, {\left (a b \cos \left (d x + c\right )^{2} - 2 \, a b\right )} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/4*(2*b^2*cos(d*x + c)^4 - 3*b^2*cos(d*x + c)^2 + 2*a^2 + b^2 - 4*((a^2 - b^2)*cos(d*x + c)^2 - a^2 + b^2)*lo
g(1/2*sin(d*x + c)) - 8*(a*b*cos(d*x + c)^2 - 2*a*b)*sin(d*x + c))/(d*cos(d*x + c)^2 - d)

________________________________________________________________________________________

giac [A]  time = 0.75, size = 99, normalized size = 1.18 \[ -\frac {b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b \sin \left (d x + c\right ) + 2 \, {\left (a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) - \frac {3 \, a^{2} \sin \left (d x + c\right )^{2} - 3 \, b^{2} \sin \left (d x + c\right )^{2} - 4 \, a b \sin \left (d x + c\right ) - a^{2}}{\sin \left (d x + c\right )^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/2*(b^2*sin(d*x + c)^2 + 4*a*b*sin(d*x + c) + 2*(a^2 - b^2)*log(abs(sin(d*x + c))) - (3*a^2*sin(d*x + c)^2 -
 3*b^2*sin(d*x + c)^2 - 4*a*b*sin(d*x + c) - a^2)/sin(d*x + c)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.24, size = 120, normalized size = 1.43 \[ -\frac {a^{2} \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {2 a b \left (\cos ^{4}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}-\frac {2 a b \left (\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{d}-\frac {4 a b \sin \left (d x +c \right )}{d}+\frac {b^{2} \left (\cos ^{2}\left (d x +c \right )\right )}{2 d}+\frac {b^{2} \ln \left (\sin \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^3*(a+b*sin(d*x+c))^2,x)

[Out]

-1/2/d*a^2*cot(d*x+c)^2-a^2*ln(sin(d*x+c))/d-2/d*a*b/sin(d*x+c)*cos(d*x+c)^4-2/d*a*b*cos(d*x+c)^2*sin(d*x+c)-4
*a*b*sin(d*x+c)/d+1/2/d*b^2*cos(d*x+c)^2+1/d*b^2*ln(sin(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.77, size = 69, normalized size = 0.82 \[ -\frac {b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b \sin \left (d x + c\right ) + 2 \, {\left (a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right )\right ) + \frac {4 \, a b \sin \left (d x + c\right ) + a^{2}}{\sin \left (d x + c\right )^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(b^2*sin(d*x + c)^2 + 4*a*b*sin(d*x + c) + 2*(a^2 - b^2)*log(sin(d*x + c)) + (4*a*b*sin(d*x + c) + a^2)/s
in(d*x + c)^2)/d

________________________________________________________________________________________

mupad [B]  time = 6.39, size = 221, normalized size = 2.63 \[ \frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2-b^2\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {a^2}{2}+8\,b^2\right )+a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {a^2}{2}+24\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+20\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-b^2\right )}{d}-\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^3*(a + b*sin(c + d*x))^2,x)

[Out]

(log(tan(c/2 + (d*x)/2)^2 + 1)*(a^2 - b^2))/d - (tan(c/2 + (d*x)/2)^4*(a^2/2 + 8*b^2) + a^2*tan(c/2 + (d*x)/2)
^2 + a^2/2 + 24*a*b*tan(c/2 + (d*x)/2)^3 + 20*a*b*tan(c/2 + (d*x)/2)^5 + 4*a*b*tan(c/2 + (d*x)/2))/(d*(4*tan(c
/2 + (d*x)/2)^2 + 8*tan(c/2 + (d*x)/2)^4 + 4*tan(c/2 + (d*x)/2)^6)) - (a^2*tan(c/2 + (d*x)/2)^2)/(8*d) - (log(
tan(c/2 + (d*x)/2))*(a^2 - b^2))/d - (a*b*tan(c/2 + (d*x)/2))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cot ^{3}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**3*(a+b*sin(d*x+c))**2,x)

[Out]

Integral((a + b*sin(c + d*x))**2*cot(c + d*x)**3, x)

________________________________________________________________________________________